<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>移动端触摸事件与click事件</title>
    <style>
        .div1{
            width:200px;
            height: 200px;
            border: 1px solid black;
        }
    </style>
</head>
<body>
    <div class="div1" ontouchstart="t(event)" onclick="c(event)">

    </div>
</body>
<script>
    /**
     * 在移动端，有两个事件触发
     * touchstart先触发
     * click后触后
     */ 
    function t(event){
        console.log(event);
        event.preventDefault();  //阻止事件的默认行为
    }
    function c(event){
        console.log(event);
    }
</script>
</html>